<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">
	<ui:param name="ctx" value="#{facesContext.externalContext.requestContextPath}" />
	<h:head>
		<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
		<meta http-equiv="Cache-Control" content="no-store" />
		<meta http-equiv="Pragma" content="no-cache" />
		<meta http-equiv="Expires" content="0" />
		
		<h:outputStylesheet library="faces" name="resources/style/list.css"/>
		<h:outputScript library="faces" name="resources/script/onion.js" target="body"/>
		<h:outputScript library="faces" name="resources/script/faces.js" target="body"/>
		<h:outputScript target="body">
			onion.ctx = "#{ctx}";
		</h:outputScript>
		<ui:insert name="head"/>
	</h:head>
	<h:body>
		<div class="content">
			<ui:insert name="body"/>
		</div>
		
		<a4j:outputPanel id="reRenderPlaceHolder" style="display:none"/>
		
		<a4j:outputPanel layout="block" style="display:none" ajaxRendered="true">
			<div id="formMessages" class="formMessages">
				<rich:messages/>
			</div>
			<script>
				(function(){
					var viewState = $("input[name='javax.faces.ViewState']").val();
				    $("form:not(:has(input[name='javax.faces.ViewState']))").each(function(id, form){
				        form = $(form);
				        var input = $("<input/>")
				        	.attr("type","hidden")
				        	.attr("name","javax.faces.ViewState")
				        	.val(viewState);
				        form.append(input);
				    });
				})();
			</script>
		</a4j:outputPanel>
		<ui:include src="/faces/messagePopup.xhtml" />
	</h:body>
</html>
